<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> 客户列表 </title>

<?php include VIEWS.'admin/style.html'?>

<script type="text/javascript">
<!--
function toggleClassNames() {
  var n = this.className;
  this.className = this.altClassName;
  this.altClassName = n;
}

function setupDatarows() {
  var v = document.getElementsByTagName("tr");
  for (var i = 0; i < v.length; i++) {
    if (v[i].className.indexOf("datarow") != -1) {
      v[i].onmouseover = toggleClassNames;
      v[i].onmouseout = toggleClassNames;
      v[i].altClassName = v[i].className + " hover";
    }
  }
}

window.onload = setupDatarows;
//-->
</script>

</head>

<body>

<?php include VIEWS.'admin/head.html'?>

<ul id="submenu">
    <li><a href='users.php' class="current">客户列表</a></li>
    <li><a href='alert.php'>商品需求</a></li>
</ul>

<div id="body">

<div style="width:98%" align="right"><form method="get"><input type="hidden" name="sort" value="<?php echo $data['sort']?>"><input type="text" name="s" value="<?php echo $data['search']?>"> <input type="submit" value="查询">&nbsp;<a href="users.php?sort=<?php echo $data['sort']?>"><small>清除搜索</small></a></form></div>

<br clear="all" />

<table class="reportV2" cellpadding="5" width="98%" cellspacing="0">
<tr class="columntitle"><td width="5%"><a href="users.php?sort=id&s=<?php echo $data['search']?>">ID</a></td><td><a href="users.php?sort=username&s=<?php echo $data['search']?>">用户名</a></td><td><a href="users.php?sort=nickname&s=<?php echo $data['search']?>">昵称</a></td><td><a href="users.php?sort=email&s=<?php echo $data['search']?>">Email</a></td><td><a href="users.php?sort=truename&s=<?php echo $data['search']?>">真实姓名</a></td><td><a href="users.php?sort=created&s=<?php echo $data['search']?>">加入时间</a></td><td>推荐人</td><td>操作</td></tr>

<?php if (count($list['list'])==0):?><tr><td colspan="9" style="text-align:left">目前暂时没有用户<td></tr><?php endif;?>

<?php foreach($list['list'] as $item):
$userslist_i++;
do_action('view_admin_eachuser', array('user'=>&$item));
?>
<tr class="<?php echo ($userslist_i % 2 ==0) ? 'even' : 'odd'?> datarow"><td><?php echo $item['id']?></td><td><?php echo $item['username']?></td><td><?php echo $item['nickname']?></td><td><?php echo $item['email']?></td><td><?php echo $item['truename']?></td><td><?php echo date('Y/m/d H:i',$item['created'])?></td><td><a href="usersedit.php?id=<?php echo $item['camefrom']?>"><b><?php echo $item['camefrom'] ? $item['camefrom'] : ''?></b></a></td><td><a href="usersedit.php?id=<?php echo $item['id']?>">修改</a> - <a href="javascript:cRedirect('usersedit.php?id=<?php echo $item['id']?>&remove=1','确认要删除用户 “<?php echo $item['username']?>” 吗？');">删除</a></td></tr>
<?php endforeach;?>
</table>

<?php include VIEWS.'admin/pages.html'?>
<?php include VIEWS.'admin/runtime.html'?>

</div>

<script type="text/javascript">
Element.addClassName('am4', 'current');
</script>

</body>
</html>
